<style>
    #incentiveRewardApply-edit .layui-form-label{
        width: 85px;
    }
    #incentiveRewardApply-edit .layui-input-block{
        margin-left: 115px;
    }
</style>
<div class="febs-container" id="incentiveRewardApply-edit">
    <div class="febs-open-body">
        <form class="layui-form" action="" lay-filter="incentiveRewardApply-edit-form">
            <fieldset class="layui-elem-field">
                <legend id="basic_field">基本信息</legend>
                <div class="layui-field-box">
                    <div class="layui-form-item febs-hide">
                        <label class="layui-form-label febs-form-item-require">主键：</label>
                        <div class="layui-input-block">
                            <input type="text" name="rewardApplyId" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item febs-hide">
                        <label class="layui-form-label febs-form-item-require">公司Id：</label>
                        <div class="layui-input-block">
                            <input type="text" name="tenantId" autocomplete="off" class="layui-input"
                                   maxlength="32" >
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-col-xs6">
                            <label class="layui-form-label febs-form-item-require">奖励类型</label>
                            <div class="layui-input-block">
                                <select name="rewardType" id="rewardType"  lay-filter="rewardType" lay-verify="required">
                                    <option value="1" checked>个人奖励</option>
                                    <option value="2">活动奖励</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-col-xs6">
                            <label class="layui-form-label febs-form-item-require">被奖励人: </label>
                            <div class="layui-input-block">
                                <button type="button" class="layui-btn layui-btn-sm " id="addUser" >
                                    <span class="layui-icon layui-icon-add-1" ></span>人员选择
                                </button>
                            </div>
                        </div>

                    </div>
                    <div class="layui-form-item">
                        <div class="layui-col-xs12">
                            <label class="layui-form-label febs-form-item-require">人员列表：</label>
                            <div class="layui-input-block">
                                <table lay-filter="rewardUserTable" id="rewardUserTable" lay-data="{id: 'rewardUserTable'}"></table>
                            </div>
                        </div>

                    </div>



                    <div class="layui-form-item">
                        <div class="layui-col-xs6">
                            <label class="layui-form-label febs-form-item-require">奖励条款</label>
                            <div class="layui-input-block layui-input-icon-container" style="position: relative">
                                <input type="text" name="rewardClauseId" autocomplete="off" class="layui-input febs-hide" maxlength="150" >
                                <input type="text" name="rewardClauseRuleId" autocomplete="off" class="layui-input febs-hide" maxlength="32" >
                                <input type="text" name="rewardClause" autocomplete="off" class="layui-input febs-hide" maxlength="150" >
                                <input type="text" name="rewardClauseRule" autocomplete="off"
                                       class="layui-input " lay-verify="required"
                                       minlength="2" maxlength="10" disabled placeholder="请选条款类型">
                                <div class="layui-input-suffix" id="addClauseBtn" >
                                    <i class="layui-icon layui-icon-add-1"></i>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item febs-hide" id="suggest">
                        <div class="layui-col-xs6">
                            <label class="layui-form-label layui-form-label-detail">建议奖励金额</label>
                            <div class="layui-input-block layui-input-block-html" id="sugAmount" data-th-text="--">
                            </div>
                        </div>
                        <div class="layui-col-xs6">
                            <label class="layui-form-label layui-form-label-detail">建议奖励积分</label>
                            <div class="layui-input-block layui-input-block-html" id="sugScore" data-th-text="--">
                            </div>
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <div class="layui-col-xs12">
                            <label class="layui-form-label febs-form-item-require">奖励原因：</label>
                            <div class="layui-input-block">
                                <textarea name="rewardReason" class="layui-textarea" maxlength="900" placeholder="请输入备注" lay-verify="required"></textarea>
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-col-xs12">
                            <label class="layui-form-label">涉及附件：</label>
                            <div class="layui-input-block">
                                <div id="fileUpload">
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </fieldset>
            <fieldset class="layui-elem-field">
                <legend id="reward_field">奖励信息</legend>
                <div class="layui-field-box">
                    <div class="layui-form-item">
                        <div class="layui-col-xs6">
                            <label class="layui-form-label ">金额奖励：</label>
                            <div class="layui-input-block">
                                <input type="checkbox" name="rewardAmountFlg"  lay-filter="rewardAmountFlg" lay-skin="switch" lay-text="是|否"/>
                            </div>
                        </div>
                        <div class="layui-col-xs6">
                            <label class="layui-form-label ">奖励金额：</label>
                            <div class="layui-input-block">
                                <input type="text" name="rewardAmount" autocomplete="off" class="layui-input" maxlength="22" placeholder="请填写金额"
                                       onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/\.{2,}/g,'.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
                                       disabled>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item febs-hide" id="bankInfo">
                        <div class="layui-col-xs6">
                            <label class="layui-form-label ">银行卡号：</label>
                            <div class="layui-input-block">
                                <input type="text" name="bankCode" autocomplete="off" class="layui-input" maxlength="64"
                                       placeholder="请填写银行卡号" disabled>
                            </div>
                        </div>
                        <div class="layui-col-xs6">
                            <label class="layui-form-label ">开户行名：</label>
                            <div class="layui-input-block">
                                <input type="text" name="bankName" autocomplete="off" class="layui-input" maxlength="150"
                                       placeholder="请填写开户行名" disabled>
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-col-xs6">
                            <label class="layui-form-label ">积分奖励：</label>
                            <div class="layui-input-block">
                                <input type="checkbox" name="rewardScoreFlg" lay-filter="rewardScoreFlg" lay-skin="switch" lay-text="是|否"/>
                            </div>
                        </div>
                        <div class="layui-col-xs6">
                            <label class="layui-form-label ">奖励积分：</label>
                            <div class="layui-input-block">
                                <input type="text" name="rewardScore" autocomplete="off" class="layui-input" maxlength="4" placeholder="请填写积分"
                                       onkeyup="value=value.replace(/[^\d{1,}\d{1,}|\d{1,}]/g,'').replace(/\./g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
                                       disabled>
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-col-xs6">
                            <label class="layui-form-label ">奖品奖励：</label>
                            <div class="layui-input-block">
                                <input type="checkbox" name="rewardGoodsFlg" lay-filter="rewardGoodsFlg" lay-skin="switch" lay-text="是|否"
                                       th:disabled="${quotaConfig} and ${quotaConfig.goodsRewardFlg eq '0'}"/>
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-col-xs12">
                            <label class="layui-form-label">奖品列表：</label>
                            <div class="layui-input-block">
                                <button type="button" class="layui-btn layui-btn-sm layui-btn-disabled" id="addGoods" style="margin-bottom: 10px" disabled>
                                    <span class="layui-icon layui-icon-add-1" ></span>选择奖品
                                </button>

                                <table lay-filter="rewardGoodsTable" id="rewardGoodsTable" lay-data="{id: 'rewardGoodsTable'}"></table>
                            </div>
                        </div>
                    </div>
                </div>
            </fieldset>

            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label febs-form-item-require">剩余额度：</label>
                    <div class="layui-input-block layui-input-block-html" id="remainingAmount"
                         data-th-text="${ #numbers.formatDecimal((quotaConfig.totalQuota - quotaConfig.rewardedQuota ),0,2)}"/>
                </div>

            </div>

            <div class="layui-form-item febs-hide">
                <button class="layui-btn" lay-submit="" lay-filter="incentiveRewardApply-edit-form-submit" id="submit"></button>
                <button class="layui-btn" lay-submit="" lay-filter="incentiveRewardApply-save-form-submit" id="save"></button>
                <button type="reset" class="layui-btn" id="reset"></button>
            </div>
        </form>
    </div>
</div>
<script data-th-inline="javascript">
    var incentiveRewardApplyData = [[${incentiveRewardApply}]];
</script>
<script type="text/html" id="rewardUserTable-tool">
    <a lay-event="del">
        <em class="layui-icon febs-edit-area febs-red">&#xe7f9;</em></a>

</script>

<script type="text/html" id="rewardGoodsTable-tool">
    <a lay-event="del">
        <em class="layui-icon febs-edit-area febs-red">&#xe7f9;</em></a>

</script>
<script th:src="@{/febs/js/incentive/incentiveRewardApply/incentiveRewardApplyEdit.js(v=1)}"></script>